﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

namespace GeneralTest
{
    class Program
    {
        private static ServiceHost host;
        static void Main(string[] args)
        {
            StartRestServiceHostVersion35(new Uri("http://localhost:7080/testrest"));
            try
            {
                host.Open();
            }
            catch (Exception)
            {

            }
            
            
            Console.WriteLine("start simple rest....");
            Console.Read();
            try
            {
                host.Close();
            }
            catch (Exception)
            {

            }
            finally
            {
                if (host.State != CommunicationState.Closed)
                    host.Abort();
            }
        }

        private static void StartRestServiceHostVersion3()
        {
            host = new RestHostVersion3();
            
        }

        private static void StartRestServiceHostVersion35(Uri url)
        {
            //host = new RestHostVersion35(url);
        }
    }
}
